/**
 * 3
 *  
 * @Author : Ruoyu Wang
 * @DateTime : 24-10-17 下午4:12
 */

#include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>

using namespace std;

unordered_map<char, int> map = {{'A', 1},
                                {'2', 2},
                                {'3', 3},
                                {'4', 4},
                                {'5', 5},
                                {'6', 6},
                                {'7', 7},
                                {'8', 8},
                                {'9', 9},
                                {'T', 10},
                                {'J', 11},
                                {'Q', 12},
                                {'K', 13}};

bool dfs(vector<int> &nums, vector<bool> &st, int k, float sum) {
    if (k == 4) {
        return sum == 20.0;
    }
    for (int i = 0; i < 4; ++i) {
        if (!st[i]) {
            st[i] = true;
            if (k == 0) {
                dfs(nums, st, k + 1, sum + nums[i]);
            } else {
                dfs(nums, st, k + 1, sum + nums[i]) ||
                dfs(nums, st, k + 1, sum - nums[i]) ||
                dfs(nums, st, k + 1, sum * nums[i]) ||
                dfs(nums, st, k + 1, sum / nums[i]);
            }
            st[i] = false;
        }
    }
}

int main() {
    char a, b, c, d;
    cin >> a >> b >> c >> d;
    vector<int> nums = {map[a], map[b], map[c], map[d]};
    vector<bool> st(4, false);

    if (dfs(nums, st, 0, 0)) {
        puts("Yes");
    } else {
        puts("No");
    }

    return 0;
}